---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A9_Results.log
  log type:  text
 opened on:  15 May 2024, 11:47:28

. ///This is the different quartiles and quintiles comp. 
> eststo clear

. use "$rootpath/processed_data/Estimation_Data.dta", clear

. drop if key_estimation_sample==0
(273,947 observations deleted)

. tab treatXpost if post==1

 treatXpost |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      6,555        1.95        1.95
   .0540541 |        799        0.24        2.19
   .0833333 |      6,444        1.92        4.11
   .1059602 |      2,581        0.77        4.88
    .122807 |     10,727        3.20        8.08
   .1355932 |      1,396        0.42        8.50
   .1502591 |      4,272        1.27        9.77
   .1578947 |      7,673        2.29       12.06
   .1666667 |        751        0.22       12.29
   .1818182 |      2,391        0.71       13.00
         .2 |      4,359        1.30       14.30
   .2131147 |      8,639        2.58       16.87
   .2307692 |     11,429        3.41       20.28
   .2372881 |      7,050        2.10       22.39
      .2475 |     21,202        6.32       28.71
        .25 |      8,760        2.61       31.32
   .2580645 |      2,498        0.74       32.07
   .2666667 |      1,749        0.52       32.59
   .3209459 |     97,438       29.06       61.64
       .325 |      2,057        0.61       62.26
   .3333333 |      1,456        0.43       62.69
   .3472222 |      8,068        2.41       65.10
   .3538461 |      2,168        0.65       65.74
   .3684211 |      2,209        0.66       66.40
   .3688889 |      5,073        1.51       67.92
       .375 |      2,356        0.70       68.62
   .3884892 |      7,667        2.29       70.90
   .4166667 |      3,819        1.14       72.04
   .4404762 |      3,461        1.03       73.08
   .4406779 |      2,301        0.69       73.76
   .4705882 |      1,264        0.38       74.14
   .4736842 |      1,914        0.57       74.71
         .5 |      3,747        1.12       75.83
   .5185185 |      2,193        0.65       76.48
   .5217391 |      5,508        1.64       78.12
   .5274725 |     29,219        8.71       86.84
   .5402299 |      4,378        1.31       88.14
   .5698925 |      8,925        2.66       90.80
   .5714285 |      4,491        1.34       92.14
         .6 |        773        0.23       92.37
   .6666666 |      5,403        1.61       93.98
   .7723133 |     18,788        5.60       99.59
          1 |      1,383        0.41      100.00
------------+-----------------------------------
      Total |    335,334      100.00

. tab avg_old_code_prob if post==1

avg_old_cod |
     e_prob |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      6,555        1.95        1.95
   .0540541 |        799        0.24        2.19
   .0833333 |      6,444        1.92        4.11
   .1059602 |      2,581        0.77        4.88
    .122807 |     10,727        3.20        8.08
   .1355932 |      1,396        0.42        8.50
   .1502591 |      4,272        1.27        9.77
   .1578947 |      7,673        2.29       12.06
   .1666667 |        751        0.22       12.29
   .1818182 |      2,391        0.71       13.00
         .2 |      4,359        1.30       14.30
   .2131147 |      8,639        2.58       16.87
   .2307692 |     11,429        3.41       20.28
   .2372881 |      7,050        2.10       22.39
      .2475 |     21,202        6.32       28.71
        .25 |      8,760        2.61       31.32
   .2580645 |      2,498        0.74       32.07
   .2666667 |      1,749        0.52       32.59
   .3209459 |     97,438       29.06       61.64
       .325 |      2,057        0.61       62.26
   .3333333 |      1,456        0.43       62.69
   .3472222 |      8,068        2.41       65.10
   .3538461 |      2,168        0.65       65.74
   .3684211 |      2,209        0.66       66.40
   .3688889 |      5,073        1.51       67.92
       .375 |      2,356        0.70       68.62
   .3884892 |      7,667        2.29       70.90
   .4166667 |      3,819        1.14       72.04
   .4404762 |      3,461        1.03       73.08
   .4406779 |      2,301        0.69       73.76
   .4705882 |      1,264        0.38       74.14
   .4736842 |      1,914        0.57       74.71
         .5 |      3,747        1.12       75.83
   .5185185 |      2,193        0.65       76.48
   .5217391 |      5,508        1.64       78.12
   .5274725 |     29,219        8.71       86.84
   .5402299 |      4,378        1.31       88.14
   .5698925 |      8,925        2.66       90.80
   .5714285 |      4,491        1.34       92.14
         .6 |        773        0.23       92.37
   .6666666 |      5,403        1.61       93.98
   .7723133 |     18,788        5.60       99.59
          1 |      1,383        0.41      100.00
------------+-----------------------------------
      Total |    335,334      100.00

. tab avg_old_code_prob

avg_old_cod |
     e_prob |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |     14,069        2.01        2.01
   .0540541 |      1,651        0.24        2.25
   .0833333 |     13,444        1.92        4.17
   .1059602 |      5,578        0.80        4.97
    .122807 |     20,442        2.92        7.89
   .1355932 |      3,039        0.43        8.33
   .1502591 |      8,932        1.28        9.61
   .1578947 |     15,518        2.22       11.83
   .1666667 |      1,664        0.24       12.07
   .1818182 |      5,078        0.73       12.79
         .2 |      9,449        1.35       14.14
   .2131147 |     17,847        2.55       16.70
   .2307692 |     23,241        3.32       20.02
   .2372881 |     15,008        2.15       22.17
      .2475 |     50,306        7.20       29.37
        .25 |     17,543        2.51       31.87
   .2580645 |      5,423        0.78       32.65
   .2666667 |      3,803        0.54       33.19
   .3209459 |    200,113       28.63       61.82
       .325 |      4,426        0.63       62.46
   .3333333 |      3,183        0.46       62.91
   .3472222 |     16,824        2.41       65.32
   .3538461 |      4,473        0.64       65.96
   .3684211 |      4,665        0.67       66.63
   .3688889 |     10,666        1.53       68.15
       .375 |      4,866        0.70       68.85
   .3884892 |     15,147        2.17       71.01
   .4166667 |      8,044        1.15       72.16
   .4404762 |      7,235        1.04       73.20
   .4406779 |      4,850        0.69       73.89
   .4705882 |      2,676        0.38       74.28
   .4736842 |      3,730        0.53       74.81
         .5 |      7,811        1.12       75.93
   .5185185 |      4,509        0.65       76.57
   .5217391 |     11,247        1.61       78.18
   .5274725 |     60,628        8.67       86.86
   .5402299 |      9,364        1.34       88.19
   .5698925 |     18,967        2.71       90.91
   .5714285 |      9,291        1.33       92.24
         .6 |      1,400        0.20       92.44
   .6666666 |     10,787        1.54       93.98
   .7723133 |     39,059        5.59       99.57
          1 |      3,017        0.43      100.00
------------+-----------------------------------
      Total |    699,013      100.00

. gen treat=1 if avg_old_code_prob>0.56
(616,492 missing values generated)

. replace treat=0 if avg_old_code_prob<0.157
(67,155 real changes made)

. drop treatXpost

. gen treatXpost=treat*post
(549,337 missing values generated)

. 
. reghdfe log_damage55 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 966 singleton observations)
(MWFE estimator converged in 229 iterations)

HDFE Linear regression                            Number of obs   =    148,710
Absorbing 2 HDFE groups                           F(   1,  17203) =      15.26
Statistics robust to heteroskedasticity           Prob > F        =     0.0001
                                                  R-squared       =     0.9426
                                                  Adj R-squared   =     0.9334
                                                  Within R-sq.    =     0.0003
Number of clusters (facility_id) =     17,204     Root MSE        =     0.4079

                       (Std. Err. adjusted for 17,204 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0317329   .0081226    -3.91   0.000    -.0476539   -.0158119
       _cons |   1.181725   .0021566   547.95   0.000     1.177498    1.185952
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     17204       17204           0    *|
     n5#year |      3235           1        3234     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store damage_d

. summarize avg_old_code_prob if treatXpost>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     39,484    .6949178    .1074858   .5698925          1

. gen tempd1 = r(mean)

. summarize avg_old_code_prob if treatXpost==0&post>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     32,572      .09154    .0509426          0   .1502591

. gen tempd2 = r(mean)

. gen tempd3=tempd1 - tempd2

. summarize tempd3

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      tempd3 |    699,013    .6033778           0   .6033778   .6033778

. display _b[treatXpost]/r(mean)
-.05259207

. drop tempd1 tempd2 tempd3

. 
. ///This is emissions
> reghdfe  log_emissions4 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 966 singleton observations)
(MWFE estimator converged in 229 iterations)

HDFE Linear regression                            Number of obs   =    148,710
Absorbing 2 HDFE groups                           F(   1,  17203) =      31.44
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9419
                                                  Adj R-squared   =     0.9327
                                                  Within R-sq.    =     0.0007
Number of clusters (facility_id) =     17,204     Root MSE        =     0.3700

                       (Std. Err. adjusted for 17,204 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0407523   .0072677    -5.61   0.000    -.0549976   -.0265069
       _cons |   1.054945   .0019296   546.71   0.000     1.051162    1.058727
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     17204       17204           0    *|
     n5#year |      3235           1        3234     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store emission_d

. summarize avg_old_code_prob if treatXpost>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     39,484    .6949178    .1074858   .5698925          1

. gen tempd1 = r(mean)

. summarize avg_old_code_prob if treatXpost==0&post>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     32,572      .09154    .0509426          0   .1502591

. gen tempd2 = r(mean)

. gen tempd3=tempd1 - tempd2

. summarize tempd3

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      tempd3 |    699,013    .6033778           0   .6033778   .6033778

. display _b[treatXpost]/r(mean)
-.06754023

. drop tempd1 tempd2 tempd3

. 
. drop treat

. gen treat=1 if avg_old_code_prob>0.475
(522,933 missing values generated)

. replace treat=0 if avg_old_code_prob<0.24
(154,960 real changes made)

. drop treatXpost

. gen treatXpost=treat*post
(367,973 missing values generated)

. 
. reghdfe  log_damage55 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 749 singleton observations)
(MWFE estimator converged in 301 iterations)

HDFE Linear regression                            Number of obs   =    330,291
Absorbing 2 HDFE groups                           F(   1,  37240) =      25.32
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9394
                                                  Adj R-squared   =     0.9306
                                                  Within R-sq.    =     0.0003
Number of clusters (facility_id) =     37,241     Root MSE        =     0.3967

                       (Std. Err. adjusted for 37,241 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0275259   .0054701    -5.03   0.000    -.0382474   -.0168043
       _cons |   1.088154   .0014012   776.61   0.000     1.085408    1.090901
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     37241       37241           0    *|
     n5#year |      4709           1        4708     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store damage_q

. ///This is emissions. 
> summarize avg_old_code_prob if treatXpost>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     84,603    .6046667     .112281         .5          1

. gen tempd1 = r(mean)

. summarize avg_old_code_prob if treatXpost==0&post>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     74,870    .1570764    .0701883          0   .2372881

. gen tempd2 = r(mean)

. gen tempd3=tempd1 - tempd2

. summarize tempd3

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      tempd3 |    699,013    .4475903           0   .4475903   .4475903

. display _b[treatXpost]/r(mean)
-.06149788

. drop tempd1 tempd2 tempd3

. 
. ///This is emissions. 
> reghdfe  log_emissions4 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 749 singleton observations)
(MWFE estimator converged in 296 iterations)

HDFE Linear regression                            Number of obs   =    330,291
Absorbing 2 HDFE groups                           F(   1,  37240) =      19.00
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9402
                                                  Adj R-squared   =     0.9314
                                                  Within R-sq.    =     0.0002
Number of clusters (facility_id) =     37,241     Root MSE        =     0.3420

                       (Std. Err. adjusted for 37,241 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0203209   .0046614    -4.36   0.000    -.0294574   -.0111844
       _cons |   .8874283    .001194   743.24   0.000      .885088    .8897686
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     37241       37241           0    *|
     n5#year |      4709           1        4708     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store emission_q

. summarize avg_old_code_prob if treatXpost>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     84,603    .6046667     .112281         .5          1

. gen tempd1 = r(mean)

. summarize avg_old_code_prob if treatXpost==0&post>0&e(sample)==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
avg_old_co~b |     74,870    .1570764    .0701883          0   .2372881

. gen tempd2 = r(mean)

. gen tempd3=tempd1 - tempd2

. summarize tempd3

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      tempd3 |    699,013    .4475903           0   .4475903   .4475903

. display _b[treatXpost]/r(mean)
-.04540069

. drop tempd1 tempd2 tempd3

. 
. esttab damage_d damage_q emission_d emission_q using "$rootpath/table_graph/TBL_A9.tex",  star( * 0.1 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt
> (3))) keep(treatXpost _cons) scalars(N F) ar2 replace 
(note: file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/TBL_A9.tex not found)
(output written to /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/TBL_A9.tex)

.  
. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A9_Results.log
  log type:  text
 closed on:  15 May 2024, 11:48:17
---------------------------------------------------------------------------------------------------------------------------------------------------------
